<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="root">
        <input type="text" :value="msg" @input="changeVal" ref="msgRef">
    </div>
    <script>
        new Vue({
            el:'#root',
            data(){
                return{
                    msg:'Hello'
                }
            },
            methods: {
                changeVal(e){
                    //console.log(e.target.value);
                    //this.msg=e.target.value
                    this.msg=this.$refs.msgRef.value
                }
            },
        })
    </script>
</body>
</html>